package com.grm.sys.service.impl;

import com.grm.sys.mapper.SysLogOperateMapper;
import com.grm.sys.model.SysLogOperate;
import com.grm.sys.request.log.operate.SysLogOperateQueryParam;
import com.grm.sys.response.SysLogOperateResponse;
import com.grm.sys.service.SysLogOperateService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * desc:
 *
 * @author gaorimao
 * @since 2023-12-07-13:59
 */
@Service
@Slf4j
public class SysLogOperateServiceImpl implements SysLogOperateService {
    @Autowired
    private SysLogOperateMapper sysLogOperateMapper;

    @Override
    public List<SysLogOperateResponse> querySelective(SysLogOperateQueryParam queryParam) {
        return sysLogOperateMapper.querySelective(queryParam);
    }

    @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
    @Override
    public void delete(List<Long> ids) {
        if (ObjectUtils.isNotEmpty(ids)) {
            sysLogOperateMapper.deleteByIds(ids);
        }
    }
}
